#include<stdio.h>
#include<iostream>
using namespace std;
int main()
{
	int i, len, flag[255 + 5] = {0}, max = -1, maxindex = -1;
	char ch,str[100+5];
	cin >> len;
	for (i = 0; i < len; i++)
	{
		cin >> ch;
		flag[ch]++;
	}
	for (i = 'a'; i <= 'z'; i++)if (flag[i] > max)
	{
		max = flag[i];
		maxindex = i;
	}
	for (i = 'A'; i <= 'Z'; i++)if (flag[i] > max)
	{
		max = flag[i];
		maxindex = i;
	}
	printf("%c\n", maxindex);
	return 0;
}